package homework31;

public class TestResourceManager {
    public static void main(String[] args) {
        // 获取单例实例
        ResourceManager manager1 = ResourceManager.getInstance();
        ResourceManager manager2 = ResourceManager.getInstance();

        // 验证是否为同一实例
        System.out.println("manager1 == manager2: " + (manager1 == manager2)); // 输出：true

        // 多次调用获取资源方法
        System.out.println("资源ID 1: " + manager1.getResource()); // 输出：1
        System.out.println("资源ID 2: " + manager1.getResource()); // 输出：2
        System.out.println("资源ID 3: " + manager2.getResource()); // 输出：3
    }
}
